{template 'public/header'}
{template 'public/comhead'}
<link rel="stylesheet" type="text/css" href="../addons/zh_cjdianc/template/public/ygcsslist.css">
<style type="text/css">
    .yg5_key>div{float: left;line-height: 34px;}
    .store_td1{height: 45px;}
    .store_list_img{width: 60px;height: 60px;}
    .yg5_tabel{border-color: #e5e5e5;outline: 1px solid #e5e5e5;}
    .yg5_tr2>td{padding: 10px 15px;border: 1px solid #e5e5e5;text-align: center;}
    .yg5_tr1>th{
        border: 1px solid #e5e5e5;
        padding-left: 15px;
        background-color: #FAFAFA;
        font-weight: bold;
        text-align: center;
    }
    .yg5_btn{background-color: #EEEEEE;color: #333;border: 1px solid #E4E4E4;border-radius: 6px;width: 100px;height: 34px;}
</style>
<ul class="nav nav-tabs">
    <span class="ygxian"></span>
    <div class="ygdangq">当前位置:</div>    
    <li class="active"><a href="{php echo $this->createWebUrl('number')}">排队列表</a></li>

</ul>
<div class="main">
    <div class="panel panel-default">
        <div class="panel-heading">
            排队列表
        </div>
        <div class="panel-body" style="padding: 0px 15px;">
            <div class="row">
                <table class="yg5_tabel col-md-12">
                    <tr class="yg5_tr1">
                        <th class="col-md-2 store_td1">桌号分类</th>
                        <th class="col-md-2">取号数量</th>                       
                         <th class="col-md-2">当前叫号</th>  
                        <th class="col-md-2">操作</th>
                    </tr>
                    {loop $list $row}
                    <tr class="yg5_tr2">
                        <td><div class="type-parent">{$row['num']}&nbsp;&nbsp;</div></td>
                        <td>{$row['count']}</td>
                         <td>{$row['dq']}</td>
                  
                        <td> 
                            <a href="{php echo $this->createWebUrl('lqnumber',array('num'=>$row['num']))}" class="storespan btn btn-xs">
                                <span class="fa fa-th-list"></span>查看已领
                            </a>
                           <a href="javascript:void(0);" class="storespan btn btn-xs jiaohao{$row['pid']}">
                                <span class="fa fa-bell-o"></span>
                                <span class="bianji">叫号
                                    <span class="arrowdown"></span>
                                </span>
                                <script type="text/javascript">
                                   $(".jiaohao{$row['pid']}").each(function(index){
                                    var id={$row['pid']}
                                    //var id = {$row['id']};
                                    // console.log(id)
                                    console.log(id)
                                        $(this).click(function(){
                                            if(confirm('确定叫号 ？')){
                                                $.ajax({   
                                                    type: "post",
                                                    dataType: "json",
                                                    url: "{$_W['siteroot']}app/index.php?i={$_W['uniacid']}&c=entry&do=QueryNumber&m=zh_cjdianc",
                                                    data:{id:id},
                                                    success: function (data) {
                                                        console.log(data);
                                                        var src=data
                                                        var audio = $("#myaudio")[0];  
                                                        $("#myaudio").attr("src",src)
                                                        audio.play();                                                         
                                                        // $("#myaudio").play()
                                                      //  location.reload();
                                                  
                                                    },
                                                    error:function (data) {
                                                        console.log(data)
                                                    }

                                                })
                                            }else{
                                                console.log("不确定")
                                            }
                                        })
                                    })

                                </script>
                            </a>
                            <a href="javascript:void(0);" class="storespan btn btn-xs desk{$row['pid']}">
                                <span class="fa fa-h-square"></span>
                                <span class="bianji">入座
                                    <span class="arrowdown"></span>
                                </span>
                                <script type="text/javascript">
                                   $(".desk{$row['pid']}").each(function(index){
                                    var id={$row['pid']}
                                    //var id = {$row['id']};
                                    // console.log(id)
                                    console.log(id)
                                        $(this).click(function(){
                                            if(confirm('确定入座 ？')){
                                                $.ajax({   
                                                    type: "post",
                                                    dataType: "json",
                                                    url: "{$_W['siteroot']}app/index.php?i={$_W['uniacid']}&c=entry&do=Pdrz&m=zh_cjdianc",
                                                    data:{id:id},
                                                    success: function (data) {
                                                        console.log(data);
                                              
                                                        location.reload();
                                                  
                                                    },
                                                    error:function (data) {
                                                        console.log(data)
                                                    }

                                                })
                                            }else{
                                                console.log("不确定")
                                            }
                                        })
                                    })
                                </script>
                            </a>  
                            <a href="javascript:void(0);" class="storespan btn btn-xs tiaoguo{$row['pid']}">
                                <span class="fa fa-share"></span>
                                <span class="bianji">跳过
                                    <span class="arrowdown"></span>
                                </span>
                                <script type="text/javascript">
                                   $(".tiaoguo{$row['pid']}").each(function(index){
                                    var id={$row['pid']}
                                    //var id = {$row['id']};
                                    // console.log(id)
                                    console.log(id)
                                        $(this).click(function(){
                                            if(confirm('确定跳过 ？')){
                                                $.ajax({   
                                                    type: "post",
                                                    dataType: "json",
                                                    url: "{$_W['siteroot']}app/index.php?i={$_W['uniacid']}&c=entry&do=Pdth&m=zh_cjdianc",
                                                    data:{id:id},
                                                    success: function (data) {
                                                        console.log(data);
                                              
                                                       location.reload();
                                                  
                                                    },
                                                    error:function (data) {
                                                        console.log(data)
                                                    }

                                                })
                                            }else{
                                                console.log("不确定")
                                            }
                                        })
                                    })
                                </script>
                            </a>                             
                          <!--   <a href="javascript:void(0);" class="storespan btn btn-xs" data-toggle="modal" data-target="#myModal{$row['id']}">
                                <span class="fa fa-trash-o"></span>
                                <span class="bianji">删除
                                    <span class="arrowdown"></span>
                                </span>
                            </a>
 -->

                         </td>
<!--                             <a href="javascript:void(0);" class="storespan btn btn-xs" data-toggle="modal" data-target="#myModal{$row['id']}">
                                <span class="fa fa-trash-o"></span>
                                <span class="bianji">用餐
                                    <span class="arrowdown"></span>
                                </span>
                            </a> -->
                            <!-- <a class="btn btn-warning btn-sm" href="{php echo $this->createWebUrl('addprint', array('id' => $row['id']))}" title="编辑">改</a>&nbsp;&nbsp;<button type="button" class="btn btn-danger btn-sm" data-toggle="modal" data-target="#myModal{$row['id']}">删</button> -->
                       
                    </tr>
                     <div class="modal fade" id="myModal{$row['id']}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
                        <div class="modal-dialog" role="document">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                                    <h4 class="modal-title" id="myModalLabel" style="font-size: 20px;">提示</h4>
                                </div>
                                <div class="modal-body" style="font-size: 20px">
                                    确定删除么？
                                </div>
                                <div class="modal-footer">
                                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                                        <a href="{php echo $this->createWebUrl('number', array('op' => 'delete', 'id' => $row['id']))}" type="button" class="btn btn-info" >确定</a>
                                </div>
                            </div>
                        </div>
                    </div>
                    {/loop}
                   
                   {if empty($list)}
                    <tr class="yg5_tr2">
                        <td colspan="11">
                          暂无排队信息
                        </td>
                    </tr>
                    {/if} 
                </table>
            </div>
        </form>
    </div>
    {$pager}
</div>
<audio id="myaudio" src=" " controls="controls"  hidden="true" ></audio>`
<script type="text/javascript">
    $(function(){
        // $("#frame-8").addClass("in");
        $("#frame-13").show();
        $("#yframe-13").addClass("wyactive");
    })
</script>
{template 'common/footer'}